package com.sq.universe.system.listener;

import com.alibaba.fastjson.JSON;
import com.sq.universe.system.entity.MsgEntity;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

@RocketMQMessageListener(topic = "system-msg",consumerGroup ="${rocketmq.consumer.group}" )
@Component
@Slf4j
public class MsgListener implements RocketMQListener<MsgEntity> {
    @Override
    public void onMessage(MsgEntity msg) {
        log.info("收到消息" + JSON.toJSONString(msg));
    }
}
